import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

public class RedisString {
    public static void main(String[] args) {
        JedisPool jedisPool = new JedisPool("tcp://127.0.0.1:8888");
        try(Jedis jedis = jedisPool.getResource()){
            test(jedis);
        }
    }
    public static void test(Jedis jedis){
        jedis.flushDB();
        jedis.set("key", "123");
        jedis.set("hjx", "sbsbsb");
        jedis.set("rht", "666");
        jedis.set("day", "612");
        System.out.println(jedis.append("key", "456"));
        System.out.println(jedis.getrange("hjx", 1, -1));
        System.out.println(jedis.incrByFloat("rht", 6.6));
        System.out.println(jedis.strlen("rht"));
        System.out.println(jedis.setrange("day", 1, "1314"));
        System.out.println(jedis.get("key"));
        System.out.println(jedis.get("hjx"));
        System.out.println(jedis.get("rht"));
        System.out.println(jedis.get("day"));
    }
}
